<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>链式高阶函数</title>
</head>
<body>
    <script>
        const nums=[10,50,90,300,40,550]
        const nums2=[10,50,90,300,40,550]
        let total=nums.filter((n)=>{
            return n<100
        }).map((n)=>{
            return n*2
        }).reduce((pre,n)=>{
            return pre+n
        },0)
        let total2=nums2.filter(n=>n<100).map(n=>n*2).reduce((pre,n)=>pre+n)
        console.log(total)
        console.log(total2)
    </script>
</body>
</html>